package com.by.wx.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.by.wx.model.script.MonitorTask;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;

/**
 * @Author 陈子杰
 * @Description
 * @Version 1.0.0
 * @Date 2025/2/12 19:14
 */
@Mapper
public interface MonitorTaskMapper extends BaseMapper<MonitorTask> {

     default List<MonitorTask> getUnfinishedTasks() {
         LambdaQueryWrapper<MonitorTask> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.eq(MonitorTask::getStatus, 0);
         queryWrapper.gt(MonitorTask::getExpirationTime, LocalDate.now());
         return selectList(queryWrapper);
     }
}
